'use strict'

function BaseAPI(agent) {
  if(Object.prototype.toString.call(agent) !== '[object Object]' || Object.prototype.toString.call(agent)==='[object Function]') {
    throw new Error('Invalid http agent');
  }
  this.agent = agent;
}

let API = BaseAPI;

// 接口备注
API.prototype.findBasicsData = function(reqBody) {
  const _req = {
    'service': 'base',
    'name': 'findBasicsData',
    'action': 'orders/base/basicEnum',
    'request': reqBody
  };

  return this.agent.send(_req, 'post')
}

module.exports = BaseAPI;